home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume13 / casette-lbl < prev    next >
Encoding:
Internet Message Format  |  1988-01-31  |  35.4 KB

  1. Subject:  v13i026:  Cassette label formatting program
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Tom Smith <analog!smith>
  7. Posting-number: Volume 13, Issue 26
  8. Archive-name: casette-lbl
  9.  
  10. This is a C program that reads files containing album title, artist, and
  11. songlist, and outputs a PostScript description of a cassette label
  12. suitable for framing or inserting into a standard-issue cassette case.
  13.  
  14. Documentation is provided in both manpage and README files, and a Makefile
  15. is here as well.
  16.  
  17. Our site connection with hplabs gets wedged at times.
  18.     Thomas Smith  {hplabs, ucbvax!sun!sunncal}!analog!smith
  19.  
  20. #! /bin/sh
  21. # This is a shell archive, meaning:
  22. # 1. Remove everything above the #! /bin/sh line.
  23. # 2. Save the resulting text in a file.
  24. # 3. Execute the file with /bin/sh (not csh) to create:
  25. #    input_file.c
  26. #    cassette.c
  27. #    output_ps.c
  28. #    overhead_ps.c
  29. #    cassette.h
  30. #    dimensions.h
  31. #    Makefile
  32. #    README
  33. #    cassette.1
  34. #    album1.sample
  35. #    album2.sample
  36. #    double.sample
  37. export PATH; PATH=/bin:/usr/bin:$PATH
  38. echo shar: "extracting 'input_file.c'" '(3566 characters)'
  39. if test -f 'input_file.c'
  40. then
  41.     echo shar: "will not over-write existing file 'input_file.c'"
  42. else
  43. sed 's/^X//' << \SHAR_EOF > 'input_file.c'
  44. X/*
  45. X * Copyright (C) 1987, Thomas H. Smith -- San Francisco, California
  46. X *   Program 'Cassette':
  47. X *    Permission is granted to any individual or institution
  48. X *    to use, copy, modify, or redistribute this software so long as it
  49. X *    is not sold for profit and provided this copyright notice is retained.
  50. X *
  51. X *   PostScript is a registered trademark of Adobe Systems, Inc.
  52. X */
  53. X#include <stdio.h>
  54. X#include <ctype.h>
  55. X#include "cassette.h"
  56. X
  57. Xstatic char buffer[BUFSIZ];
  58. Xstatic char *bufferlist[BUFSIZ];
  59. Xchar *create_string(), *strip_white();
  60. X
  61. X
  62. Xchar *
  63. Xinput_title(fd)
  64. XFILE *fd;
  65. X{
  66. X    buffer[0] = '\0';
  67. X    (void) fgets(buffer, BUFSIZ, fd);
  68. X    /* nuke trailing newline */
  69. X    buffer[strlen(buffer) - 1] = '\0';
  70. X    escape_parens(buffer);
  71. X    return(create_string(strip_white(buffer)));
  72. X}
  73. X
  74. X
  75. Xchar *
  76. Xinput_artist(fd)
  77. XFILE *fd;
  78. X{
  79. X    buffer[0] = '\0';
  80. X    (void) fgets(buffer, BUFSIZ, fd);
  81. X    /* nuke trailing newline */
  82. X    buffer[strlen(buffer) - 1] = '\0';
  83. X    escape_parens(buffer);
  84. X    return(create_string(strip_white(buffer)));
  85. X}
  86. X
  87. X
  88. Xchar *
  89. Xinput_noise_reduction(fd, noise_type)
  90. XFILE *fd;
  91. Xint *noise_type;
  92. X{
  93. X    char *noise;
  94. X
  95. X    buffer[0] = '\0';
  96. X    (void) fgets(buffer, BUFSIZ, fd);
  97. X    /* nuke trailing newline */
  98. X    buffer[strlen(buffer) - 1] = '\0';
  99. X    escape_parens(buffer);
  100. X    noise = create_string(strip_white(buffer));
  101. X
  102. X    /* see if this is a common noise reduction type */
  103. X    if (noise[0] == '\0') {
  104. X    *noise_type = NONE;
  105. X    } else if ((strncmp(noise, "dolby", 5) == 0) ||
  106. X                (strncmp(noise, "Dolby", 5) == 0)) {
  107. X    if ((noise[strlen(noise)-1] == 'c') || (noise[strlen(noise)-1] == 'C'))
  108. X        *noise_type = DOLBY_C;
  109. X    else
  110. X        *noise_type = DOLBY_B;
  111. X    } else if ((strcmp(noise, "dbx") == 0) || (strcmp(noise, "DBX") == 0)) {
  112. X    *noise_type = DBX;
  113. X    } else {
  114. X    *noise_type = OTHER;
  115. X    }
  116. X
  117. X    return(noise);
  118. X}
  119. X
  120. X
  121. Xchar **
  122. Xinput_songs(fd)
  123. XFILE *fd;
  124. X{
  125. X    register int index;
  126. X    char **returnlist;
  127. X    extern char *malloc();
  128. X
  129. X    buffer[0] = '\0';
  130. X    for (index = 0; index < BUFSIZ; index++) {
  131. X    if (fgets(buffer, BUFSIZ, fd) == NULL)
  132. X        break;
  133. X    /* nuke trailing newline */
  134. X    buffer[strlen(buffer) - 1] = '\0';
  135. X    if (EMPTYSTRING(buffer))
  136. X        break;
  137. X    escape_parens(buffer);
  138. X    bufferlist[index] = create_string(strip_white(buffer));
  139. X    }
  140. X
  141. X    returnlist = (char **) malloc((unsigned) index * sizeof(char *) + 1);
  142. X    bcopy((char *) bufferlist, (char *) returnlist, index * sizeof(char *));
  143. X    returnlist[index] = (char *) NULL;
  144. X    return(returnlist);
  145. X}
  146. X
  147. X
  148. Xfree_song_list(songs)
  149. Xchar **songs;
  150. X{
  151. X    register int index;
  152. X
  153. X    for (index = 0; songs[index] != NULL; index++)
  154. X    (void) free(songs[index]);
  155. X    free((char *) songs);
  156. X}
  157. X
  158. X
  159. Xstatic
  160. Xescape_parens(srcbuffer)
  161. Xchar *srcbuffer;
  162. X{
  163. X    register char *src, *dest;
  164. X    char destbuffer[BUFSIZ];
  165. X    extern char *strcpy();
  166. X
  167. X    for (src = srcbuffer, dest = destbuffer;
  168. X                (dest < &(destbuffer[BUFSIZ-1])) && (*src != '\0');
  169. X                src++, dest++) {
  170. X    if ((*src == '(') || (*src == ')'))
  171. X        *dest++ = '\\';
  172. X    *dest = *src;
  173. X    }
  174. X    *dest = '\0';
  175. X    (void) strcpy(srcbuffer, destbuffer);
  176. X}
  177. X
  178. X
  179. Xstatic char *
  180. Xstrip_white(string)
  181. Xchar *string;
  182. X{
  183. X    register char *begin, *end;
  184. X
  185. X    for (begin = string; isspace(*begin) && (*begin != '\0'); begin++) ;
  186. X    for (end = &(begin[strlen(string) - 1]);
  187. X                isspace(*end) && (end != begin); end--) ;
  188. X    if (end != begin)
  189. X    *++end = '\0';
  190. X
  191. X    return(begin);
  192. X}
  193. X
  194. X
  195. Xstatic char *
  196. Xcreate_string(str)
  197. Xchar *str;
  198. X{
  199. X    char *newstring;
  200. X    extern char *malloc(), *strcpy();
  201. X
  202. X    newstring = malloc((unsigned) strlen(str) + 1);
  203. X    (void) strcpy(newstring, str);
  204. X    return(newstring);
  205. X}
  206. SHAR_EOF
  207. if test 3566 -ne "`wc -c < 'input_file.c'`"
  208. then
  209.     echo shar: "error transmitting 'input_file.c'" '(should have been 3566 characters)'
  210. fi
  211. fi
  212. echo shar: "extracting 'cassette.c'" '(2411 characters)'
  213. if test -f 'cassette.c'
  214. then
  215.     echo shar: "will not over-write existing file 'cassette.c'"
  216. else
  217. sed 's/^X//' << \SHAR_EOF > 'cassette.c'
  218. X/*
  219. X * Copyright (C) 1987, Thomas H. Smith -- San Francisco, California
  220. X *   Program 'Cassette':
  221. X *    Permission is granted to any individual or institution
  222. X *    to use, copy, modify, or redistribute this software so long as it
  223. X *    is not sold for profit and provided this copyright notice is retained.
  224. X *
  225. X *   PostScript is a registered trademark of Adobe Systems, Inc.
  226. X */
  227. X#include <stdio.h>
  228. X#include "cassette.h"
  229. X
  230. Xmain(argc, argv)
  231. Xint argc;
  232. Xchar *argv[];
  233. X{
  234. X    FILE *open_file();
  235. X    char *album1, *album2;
  236. X    int number_songs = FALSE;
  237. X
  238. X    album1 = argv[1];
  239. X    album2 = argv[2];
  240. X
  241. X    if (argc > 1) {
  242. X    if (strcmp(argv[1], "-n") == 0) {
  243. X        number_songs = TRUE;
  244. X        argc--;
  245. X        album1 = argv[2];
  246. X        album2 = argv[3];
  247. X    }
  248. X    }
  249. X
  250. X    if ((argc != 3) && (argc != 2)) {
  251. X    (void) fprintf(stderr, "usage: %s  [-n] <album1 file> [<album2 file>]",
  252. X                                    argv[0]);
  253. X    exit(1);
  254. X    }
  255. X
  256. X    output_ps_globals();
  257. X    output_ps_outline();
  258. X    if (argc == 2) {
  259. X    file_to_postscript(open_file(album1), number_songs, ONLY);
  260. X    } else {
  261. X    file_to_postscript(open_file(album1), number_songs, SIDE1);
  262. X    file_to_postscript(open_file(album2), number_songs, SIDE2);
  263. X    }
  264. X    output_ps_trailer();
  265. X}
  266. X
  267. X
  268. XFILE *
  269. Xopen_file(filename)
  270. Xchar *filename;
  271. X{
  272. X    FILE *fd, *fopen();
  273. X
  274. X    fd = fopen(filename, "r");
  275. X    if (fd == NULL) {
  276. X    perror(filename);
  277. X    exit(1);
  278. X    }
  279. X    return(fd);
  280. X}
  281. X
  282. X
  283. Xfile_to_postscript(file, number_songs, position)
  284. XFILE *file;
  285. Xint number_songs, position;
  286. X{
  287. X    char *title, *artist, *noise_red, **songs1, **songs2;
  288. X    int noise_type;
  289. X    extern char *input_title(), *input_artist(), *input_noise_reduction();
  290. X    extern char **input_songs();
  291. X
  292. X    artist = input_artist(file);
  293. X    title = input_title(file);
  294. X    noise_red = input_noise_reduction(file, &noise_type);
  295. X    songs1 = input_songs(file);
  296. X    if (position == ONLY)        /* look for two-record sets */
  297. X    songs2 = input_songs(file);
  298. X
  299. X    output_ps_artist(title, artist, position);
  300. X    output_ps_title(title, artist, position);
  301. X    output_ps_noise_reduction(noise_red, noise_type, position);
  302. X    if ((position == ONLY) && (songs2[0] != NULL)) {
  303. X    output_ps_songs(songs1, number_songs, SIDE1);
  304. X    output_ps_songs(songs2, number_songs, SIDE2);
  305. X    } else {
  306. X    output_ps_songs(songs1, number_songs, position);
  307. X    }
  308. X
  309. X    (void) free(artist);
  310. X    (void) free(title);
  311. X    (void) free(noise_red);
  312. X    free_song_list(songs1);
  313. X    if (position == ONLY)
  314. X    free_song_list(songs2);
  315. X}
  316. SHAR_EOF
  317. if test 2411 -ne "`wc -c < 'cassette.c'`"
  318. then
  319.     echo shar: "error transmitting 'cassette.c'" '(should have been 2411 characters)'
  320. fi
  321. fi
  322. echo shar: "extracting 'output_ps.c'" '(5556 characters)'
  323. if test -f 'output_ps.c'
  324. then
  325.     echo shar: "will not over-write existing file 'output_ps.c'"
  326. else
  327. sed 's/^X//' << \SHAR_EOF > 'output_ps.c'
  328. X/*
  329. X * Copyright (C) 1987, Thomas H. Smith -- San Francisco, California
  330. X *   Program 'Cassette':
  331. X *    Permission is granted to any individual or institution
  332. X *    to use, copy, modify, or redistribute this software so long as it
  333. X *    is not sold for profit and provided this copyright notice is retained.
  334. X *
  335. X *   PostScript is a registered trademark of Adobe Systems, Inc.
  336. X */
  337. X#include <stdio.h>
  338. X#include "dimensions.h"
  339. X#include "cassette.h"
  340. X
  341. X
  342. Xoutput_ps_artist(title, artist, position)
  343. Xchar *title, *artist;
  344. Xint position;
  345. X{
  346. X    OUTPUT("\n%%\tArtist\n");
  347. X    if (EMPTYSTRING(title)) {
  348. X    OUTPUT("%%\t\tNo artist specified\n");
  349. X    return;
  350. X    }
  351. X
  352. X    OUTPUT("/%s findfont %.3f doscalefont setfont\n", ARTISTFONT, ARTISTSIZE);
  353. X    switch (position) {
  354. X    case ONLY:
  355. X        OUTPUT("/linestart {\n  %.3f inches\n", WIDTH / 2.0);
  356. X        OUTPUT("  (%s) stringwidth pop 2 div sub\n} def\n", artist);
  357. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH, HSPACE);
  358. X        break;
  359. X    case SIDE1:
  360. X        OUTPUT("/linestart %.3f def\n", HSPACE + (BORDERWIDTH / 2));
  361. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH / 2.0, HSPACE);
  362. X        break;
  363. X    case SIDE2:
  364. X        OUTPUT("/linestart %.3f inches def\n", WIDTH / 2.0);
  365. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH, HSPACE);
  366. X        break;
  367. X    }
  368. X
  369. X    OUTPUT("linestart %.3f inches %.3f sub moveto\n",
  370. X                    BODYHEIGHT + EDGEHEIGHT,
  371. X                    ARTISTSIZE + VSPACE +
  372. X                    BORDERWIDTH - CHARFUDGE);
  373. X
  374. X    OUTPUT("(%s) shrinkshow\n", artist);
  375. X}
  376. X
  377. X
  378. Xoutput_ps_title(title, artist, position)
  379. Xchar *title, *artist;
  380. Xint position;
  381. X{
  382. X    OUTPUT("\n%%\tTitle\n");
  383. X    OUTPUT("/%s findfont %.3f doscalefont setfont\n", TITLEFONT, TITLESIZE);
  384. X
  385. X    if (EMPTYSTRING(title)) {
  386. X    /* self-titled -- use artist for title */
  387. X    title = artist;
  388. X    }
  389. X
  390. X    switch (position) {
  391. X    case ONLY:
  392. X        OUTPUT("/linestart {\n  %.3f inches\n", WIDTH / 2.0);
  393. X        OUTPUT("  (%s) stringwidth pop 2 div sub\n} def\n", title);
  394. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH, HSPACE);
  395. X        break;
  396. X    case SIDE1:
  397. X        OUTPUT("/linestart %.3f def\n", HSPACE + (BORDERWIDTH / 2));
  398. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH / 2.0, HSPACE);
  399. X        break;
  400. X    case SIDE2:
  401. X        OUTPUT("/linestart %.3f inches def\n", WIDTH / 2.0);
  402. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH, HSPACE);
  403. X        break;
  404. X    }
  405. X
  406. X    OUTPUT("linestart %.3f inches %.3f add moveto\n", BODYHEIGHT,
  407. X                    VSPACE + BORDERWIDTH + CHARFUDGE);
  408. X
  409. X    if (title == artist) {
  410. X    /* if self-titled, center title vertically */
  411. X    OUTPUT("0 %.3f inches %.3f sub rmoveto\n", EDGEHEIGHT / 2.0,
  412. X                    VSPACE + BORDERWIDTH + (TITLESIZE / 2.0));
  413. X    }
  414. X
  415. X    OUTPUT("(%s) shrinkshow\n", title);
  416. X
  417. X    /* secondary title */
  418. X    OUTPUT("\n%%\tSecondary Title\n");
  419. X    OUTPUT("/%s findfont %.3f doscalefont setfont\n", TITLE2FONT, TITLE2SIZE);
  420. X
  421. X    switch (position) {
  422. X    case ONLY:
  423. X    case SIDE1:
  424. X        OUTPUT("/linestart %.3f def\n", HSPACE + (BORDERWIDTH / 2));
  425. X        OUTPUT("/lineend %.3f inches %.3f sub def\n",
  426. X                    (WIDTH / 2.0) - .33, HSPACE);
  427. X        break;
  428. X    case SIDE2:
  429. X        OUTPUT("/linestart %.3f inches %.3f add def\n", WIDTH / 2.0,
  430. X                    HSPACE + (DASHWIDTH / 2));
  431. X        OUTPUT("/lineend %.3f inches %.3f sub def\n", WIDTH - .33, HSPACE);
  432. X        break;
  433. X    }
  434. X
  435. X    OUTPUT("linestart %.3f inches %.3f sub moveto\n", BODYHEIGHT,
  436. X                    TITLE2SIZE + VSPACE + BORDERWIDTH);
  437. X    OUTPUT("(%s) elipsesshow\n", title);
  438. X}
  439. X
  440. X
  441. Xoutput_ps_noise_reduction(noise_red, noise_type, position)
  442. Xchar *noise_red;
  443. Xint noise_type, position;
  444. X{
  445. X    OUTPUT("\n%%\tNoise reduction symbol\n");
  446. X    if (noise_type == NONE) {
  447. X    OUTPUT("%%\t(None specified)\n");
  448. X    return;
  449. X    }
  450. X
  451. X    OUTPUT("/%s findfont %.3f doscalefont setfont\n",
  452. X                            NOISEFONT, NOISESIZE);
  453. X    if ((position == ONLY) || (position == SIDE1)) {
  454. X    OUTPUT("%.3f inches %.3f sub %.3f inches %.3f sub moveto\n",
  455. X                    WIDTH / 2.0,
  456. X                    HSPACE + (DASHWIDTH / 2), BODYHEIGHT,
  457. X                    TITLE2SIZE + VSPACE + BORDERWIDTH);
  458. X    } else /* SIDE2 */ {
  459. X    OUTPUT("%.3f inches %.3f sub %.3f inches %.3f sub moveto\n",
  460. X                    WIDTH,
  461. X                    HSPACE + (BORDERWIDTH / 2), BODYHEIGHT,
  462. X                    TITLE2SIZE + VSPACE + BORDERWIDTH);
  463. X    }
  464. X
  465. X    switch (noise_type) {
  466. X    case DOLBY_B:
  467. X        OUTPUT("dolby\n");
  468. X        return;
  469. X    case DOLBY_C:
  470. X        OUTPUT("( C) stringwidth pop -1 mul 0 rmoveto dolby ( C) show\n");
  471. X        return;
  472. X    /* case DBX: */
  473. X    }
  474. X
  475. X    /* other type of noise reduction */
  476. X    OUTPUT("(%s) stringwidth pop -1 mul 0 rmoveto\n", noise_red);
  477. X    OUTPUT("(%s) show\n", noise_red);
  478. X}
  479. X
  480. X
  481. Xoutput_ps_songs(songs, number_songs, position)
  482. Xchar **songs;
  483. Xint number_songs, position;
  484. X{
  485. X    register int index;
  486. X
  487. X    OUTPUT("\n%%\tSong list\n");
  488. X    OUTPUT("/%s findfont %.3f doscalefont setfont\n", SONGFONT, SONGSIZE);
  489. X
  490. X    if ((position == ONLY) || (position == SIDE1)) {
  491. X    OUTPUT("/linestart %.3f def\n", HSPACE + (BORDERWIDTH / 2));
  492. X    OUTPUT("/lineend %.3f inches %.3f sub def\n",
  493. X                    WIDTH / 2.0, HSPACE + (DASHWIDTH / 2));
  494. X    } else /* SIDE2 */ {
  495. X    OUTPUT("/linestart %.3f inches %.3f add def\n",
  496. X                    WIDTH / 2.0, HSPACE + (DASHWIDTH / 2));
  497. X    OUTPUT("/lineend %.3f inches %.3f sub def\n",
  498. X                    WIDTH, HSPACE + (BORDERWIDTH / 2));
  499. X    }
  500. X
  501. X    /* starting position */
  502. X    OUTPUT("\nlinestart %.3f inches %.3f sub moveto\n", BODYHEIGHT,
  503. X                    TITLE2SIZE + SONGSIZE + (VSPACE * 3)
  504. X                            + BORDERWIDTH + DASHWIDTH);
  505. X
  506. X    /* array of song titles */
  507. X    OUTPUT("[\n");
  508. X    for (index = 0; songs[index] != NULL; index++) {
  509. X    if (number_songs)
  510. X        OUTPUT("  (%d.   %s)\n", index + 1, songs[index]);
  511. X    else
  512. X        OUTPUT("  (%s)\n", songs[index]);
  513. X    }
  514. X    OUTPUT("] { dosong } forall\n");
  515. X}
  516. SHAR_EOF
  517. if test 5556 -ne "`wc -c < 'output_ps.c'`"
  518. then
  519.     echo shar: "error transmitting 'output_ps.c'" '(should have been 5556 characters)'
  520. fi
  521. fi
  522. echo shar: "extracting 'overhead_ps.c'" '(6924 characters)'
  523. if test -f 'overhead_ps.c'
  524. then
  525.     echo shar: "will not over-write existing file 'overhead_ps.c'"
  526. else
  527. sed 's/^X//' << \SHAR_EOF > 'overhead_ps.c'
  528. X/*
  529. X * Copyright (C) 1987, Thomas H. Smith -- San Francisco, California
  530. X *   Program 'Cassette':
  531. X *    Permission is granted to any individual or institution
  532. X *    to use, copy, modify, or redistribute this software so long as it
  533. X *    is not sold for profit and provided this copyright notice is retained.
  534. X *
  535. X *   PostScript is a registered trademark of Adobe Systems, Inc.
  536. X *   The name 'Dolby' and the Dolby symbol are trademarks
  537. X *    of Dolby Industries, Inc.
  538. X */
  539. X#include <stdio.h>
  540. X#include "dimensions.h"
  541. X#include "cassette.h"
  542. X
  543. X
  544. Xoutput_ps_globals()
  545. X{
  546. X    /* global definitions */
  547. X    OUTPUT("%%\tglobals\n");
  548. X    OUTPUT("/inches { 72 mul } def\n");
  549. X    OUTPUT("/currentx { currentpoint pop } def\n");
  550. X    OUTPUT("/currenty { currentpoint exch pop } def\n");
  551. X    OUTPUT("/lowerdone { false } def\n");
  552. X    OUTPUT("/doscalefont {\n  dup dup /maxfontsize exch def\n");
  553. X    OUTPUT("  /fontsize exch def scalefont\n} def\n");
  554. X    OUTPUT("/adjustfont {\n  dup /fontsize exch fontsize mul def\n");
  555. X    OUTPUT("  scalefont\n} def\n");
  556. X    OUTPUT("/interline { fontsize 1.33 mul } def\n");
  557. X    OUTPUT("/creturn { linestart currenty interline sub moveto } def\n");
  558. X
  559. X    OUTPUT("/overflowsline {");
  560. X    OUTPUT("  stringwidth pop currentx add lineend ge } def\n");
  561. X    OUTPUT("/indent { %.3f inches 0 rmoveto } def\n", CONTINUEDIST);
  562. X    OUTPUT("/breakline {\n  {\n    ( ) search exch\n");
  563. X    OUTPUT("    dup overflowsline {\n      creturn pageoverflow indent\n");
  564. X    OUTPUT("    } if show\n    {\t%% test of search\n      show\n");
  565. X    OUTPUT("    } { exit } ifelse\n  } loop\n} def\n");
  566. X
  567. X    OUTPUT("/shrinkshow {\n  {\n    dup overflowsline {\n");
  568. X    OUTPUT("      currentfont .9 adjustfont setfont\n");
  569. X    OUTPUT("      fontsize maxfontsize 2 div 1 add le {\n");
  570. X    OUTPUT("        /oldindent /indent load def /indent { } def\n");
  571. X    OUTPUT("        0 fontsize rmoveto breakline\n");
  572. X    OUTPUT("        /indent /oldindent load def\n");
  573. X    OUTPUT("        exit\n      } if\n");
  574. X    OUTPUT("    } {\n      linestart currenty moveto\n");
  575. X    OUTPUT("      show exit\n    } ifelse\n  } loop\n} def\n");
  576. X
  577. X    OUTPUT("/elipsesshow {\n  dup overflowsline {\n");
  578. X    OUTPUT("    {\n      ( ) search exch dup overflowsline {\n");
  579. X    OUTPUT("        (...) show pop { pop } if pop exit\n");
  580. X    OUTPUT("      } {\n        show\n      } ifelse\n");
  581. X    OUTPUT("      {\t%%test of search\n        show\n");
  582. X    OUTPUT("      } { exit } ifelse\n    } loop\n");
  583. X    OUTPUT("  } { show } ifelse\n} def\n");
  584. X
  585. X    OUTPUT("/pageoverflow {\n  currenty %.3f le lowerdone not and {\n",
  586. X                            VSPACE + BORDERWIDTH);
  587. X    OUTPUT("    dolowerblock linestart -%.3f moveto\n  } if\n} def\n",
  588. X                        SONGSIZE + VSPACE + BORDERWIDTH);
  589. X
  590. X    OUTPUT("/dosong {\n  pageoverflow\n");
  591. X    OUTPUT("  dup overflowsline {\n    breakline\n");
  592. X    OUTPUT("  } {\n    show\n  } ifelse\n  creturn\n");
  593. X    OUTPUT("} def\n");
  594. X
  595. X    /* extra lower outline if necessary */
  596. X    OUTPUT("%%\textra lower block outline\n");
  597. X    OUTPUT("/dolowerblock {\n");
  598. X    OUTPUT("  gsave newpath [] 0 setdash 0 0 moveto\n");
  599. X    OUTPUT("  0 -%.3f inches lineto\n", BODYHEIGHT);
  600. X    OUTPUT("  %.3f inches -%.3f inches lineto\n", WIDTH, BODYHEIGHT);
  601. X    OUTPUT("  %.3f inches 0 lineto\n", WIDTH);
  602. X
  603. X    OUTPUT("  %.3f setlinewidth stroke\n", BORDERWIDTH);
  604. X    OUTPUT("  0 0 moveto %.3f inches 0 lineto\n", WIDTH);
  605. X    OUTPUT("  %.3f setlinewidth stroke\n", (BORDERWIDTH * 2));
  606. X
  607. X    OUTPUT("  %.3f inches -%.3f inches %.3f add moveto\n", WIDTH / 2.0,
  608. X                        BODYHEIGHT, VSPACE + BORDERWIDTH);
  609. X    OUTPUT("  %.3f inches -%.3f lineto\n", WIDTH / 2.0,
  610. X                        VSPACE + (BORDERWIDTH / 2));
  611. X    OUTPUT("  [.3 1] 0 setdash %.3f setlinewidth stroke\n", DASHWIDTH);
  612. X    OUTPUT("  /lowerdone { true } def\n");
  613. X    OUTPUT("  grestore\n} def\n");
  614. X
  615. X    output_ps_dolby();
  616. X}
  617. X
  618. X
  619. Xoutput_ps_outline()
  620. X{
  621. X    OUTPUT("\n%%\toutline of label\n");
  622. X
  623. X    /* body of label */
  624. X    OUTPUT("newpath\n");
  625. X    OUTPUT("0 0 moveto\n");
  626. X    OUTPUT("0 %.3f inches lineto\n", BODYHEIGHT + EDGEHEIGHT);
  627. X    OUTPUT("%.3f inches %.3f inches lineto\n",
  628. X                    WIDTH, BODYHEIGHT + EDGEHEIGHT);
  629. X    OUTPUT("%.3f inches 0 lineto\n", WIDTH);
  630. X    OUTPUT("closepath %.3f setlinewidth stroke\n", BORDERWIDTH);
  631. X
  632. X    /* edge of label */
  633. X    OUTPUT("newpath\n");
  634. X    OUTPUT("0 %.3f inches moveto\n", BODYHEIGHT);
  635. X    OUTPUT("%.3f inches %.3f inches lineto\n", WIDTH, BODYHEIGHT);
  636. X    OUTPUT("0 %.3f inches moveto\n", BODYHEIGHT + EDGEHEIGHT);
  637. X    OUTPUT("%.3f inches %.3f inches lineto\n",
  638. X                    WIDTH, BODYHEIGHT + EDGEHEIGHT);
  639. X    OUTPUT("%.3f setlinewidth stroke\n", BORDERWIDTH * 2);
  640. X
  641. X    /* overhang of label */
  642. X    OUTPUT("newpath\n");
  643. X    OUTPUT("0 %.3f inches moveto\n", BODYHEIGHT + EDGEHEIGHT);
  644. X    OUTPUT("0 %.3f inches rlineto %.3f inches 0 rlineto\n", TABSHORTHEIGHT,
  645. X        ((WIDTH - TABWIDTH) / 2.0) - TABDELTA);
  646. X    OUTPUT("%.3f inches %.3f inches rlineto\n", TABDELTA, TABDELTA);
  647. X    OUTPUT("%.3f inches 0 rlineto\n", TABWIDTH);
  648. X    OUTPUT("%.3f inches -%.3f inches rlineto\n", TABDELTA, TABDELTA);
  649. X    OUTPUT("%.3f inches %.3f inches lineto\n",
  650. X                WIDTH, BODYHEIGHT + EDGEHEIGHT + TABSHORTHEIGHT);
  651. X    OUTPUT("0 -%.3f inches rlineto\n", TABSHORTHEIGHT);
  652. X    OUTPUT("%.3f setlinewidth stroke\n", BORDERWIDTH);
  653. X
  654. X    /* dashed interior lines */
  655. X    OUTPUT("\n%%\tdashed interior lines\n");
  656. X
  657. X    OUTPUT("newpath\n");
  658. X    OUTPUT("0 %.3f inches %.3f sub moveto\n", BODYHEIGHT,
  659. X                    TITLE2SIZE + (VSPACE * 2) + BORDERWIDTH);
  660. X    OUTPUT("%.3f inches %.3f inches %.3f sub lineto\n", WIDTH, BODYHEIGHT,
  661. X                    TITLE2SIZE + (VSPACE * 2) + BORDERWIDTH);
  662. X
  663. X    OUTPUT("%.3f inches %.3f inches %.3f sub moveto\n", WIDTH / 2.0,
  664. X                        BODYHEIGHT, VSPACE + BORDERWIDTH);
  665. X    OUTPUT("%.3f inches %.3f lineto\n", WIDTH / 2.0,
  666. X                        VSPACE + (BORDERWIDTH / 2));
  667. X
  668. X    OUTPUT("[.3 1] 0 setdash %.3f setlinewidth stroke\n", DASHWIDTH);
  669. X}
  670. X
  671. X
  672. Xoutput_ps_trailer()
  673. X{
  674. X    OUTPUT("showpage\n");
  675. X}
  676. X
  677. X
  678. Xstatic
  679. Xoutput_ps_dolby()
  680. X{
  681. X    OUTPUT("%%\t\tDolby trademark symbol\n");
  682. X    OUTPUT("%%\t\t\tThe name Dolby and this symbol\n");
  683. X    OUTPUT("%%\t\t\tare trademarks of Dolby Industries, Inc.\n");
  684. X    OUTPUT("/dolby {\n");
  685. X    OUTPUT("  gsave -%.3f 0 rmoveto currentpoint newpath\n", DOLBY_WIDTH);
  686. X    OUTPUT("  %.3f add %.3f -90 90 arc\n", DOLBY_RADIUS, DOLBY_RADIUS);
  687. X    OUTPUT("  currentx %.3f add currenty %.3f sub %.3f 90 -90 arc\n",
  688. X                    DOLBY_WIDTH, DOLBY_RADIUS, DOLBY_RADIUS);
  689. X    OUTPUT("  -%.3f 0 rmoveto\n", DOLBY_WIDTH);
  690. X    OUTPUT("  0 setgray currentpoint fill moveto\n");
  691. X
  692. X    /* line around it */
  693. X    OUTPUT("  0 %.3f rlineto %.3f 0 rlineto\n",
  694. X                        DOLBY_HEIGHT, DOLBY_WIDTH);
  695. X    OUTPUT("  0 -%.3f rlineto -%.3f 0 rlineto\n",
  696. X                        DOLBY_HEIGHT, DOLBY_WIDTH);
  697. X    OUTPUT("  [] 0 setdash 0 setlinewidth currentpoint stroke moveto\n");
  698. X
  699. X    /* line through center */
  700. X    OUTPUT("  %.3f 0 rmoveto 0 %.3f rlineto\n",
  701. X                    DOLBY_WIDTH / 2.0, DOLBY_HEIGHT);
  702. X    OUTPUT("  1 setgray stroke\n");
  703. X    OUTPUT("  grestore\n} def\n");
  704. X}
  705. SHAR_EOF
  706. if test 6924 -ne "`wc -c < 'overhead_ps.c'`"
  707. then
  708.     echo shar: "error transmitting 'overhead_ps.c'" '(should have been 6924 characters)'
  709. fi
  710. fi
  711. echo shar: "extracting 'cassette.h'" '(669 characters)'
  712. if test -f 'cassette.h'
  713. then
  714.     echo shar: "will not over-write existing file 'cassette.h'"
  715. else
  716. sed 's/^X//' << \SHAR_EOF > 'cassette.h'
  717. X/*
  718. X * Copyright (C) 1987, Thomas H. Smith -- San Francisco, California
  719. X *   Program 'Cassette':
  720. X *    Permission is granted to any individual or institution
  721. X *    to use, copy, modify, or redistribute this software so long as it
  722. X *    is not sold for profit and provided this copyright notice is retained.
  723. X *
  724. X *   PostScript is a registered trademark of Adobe Systems, Inc.
  725. X */
  726. X
  727. X#define TRUE    (1)
  728. X#define FALSE    (0)
  729. X
  730. X/* cassette sides */
  731. X#define ONLY    0
  732. X#define SIDE1    1
  733. X#define SIDE2    2
  734. X
  735. X/* recognized noise reduction types */
  736. X#define NONE    0
  737. X#define DOLBY_B    1
  738. X#define DOLBY_C    2
  739. X#define DBX    3
  740. X#define OTHER    4
  741. X
  742. X#define OUTPUT            (void) printf
  743. X#define EMPTYSTRING(str)    (str[0] == '\0')
  744. SHAR_EOF
  745. if test 669 -ne "`wc -c < 'cassette.h'`"
  746. then
  747.     echo shar: "error transmitting 'cassette.h'" '(should have been 669 characters)'
  748. fi
  749. fi
  750. echo shar: "extracting 'dimensions.h'" '(1774 characters)'
  751. if test -f 'dimensions.h'
  752. then
  753.     echo shar: "will not over-write existing file 'dimensions.h'"
  754. else
  755. sed 's/^X//' << \SHAR_EOF > 'dimensions.h'
  756. X/*
  757. X * Copyright (C) 1987, Thomas H. Smith -- San Francisco, California
  758. X *   Program 'Cassette':
  759. X *    Permission is granted to any individual or institution
  760. X *    to use, copy, modify, or redistribute this software so long as it
  761. X *    is not sold for profit and provided this copyright notice is retained.
  762. X *
  763. X *   PostScript is a registered trademark of Adobe Systems, Inc.
  764. X */
  765. X
  766. X/* dimension tweaks dimensions in points */
  767. X#define VSPACE        4.0    /* vertical whitespace border */
  768. X#define HSPACE        6.0    /* horizontal whitespace border */
  769. X#define BORDERWIDTH    2.0    /* width of outline border */
  770. X#define DASHWIDTH    0.25    /* width of interior dashed lines */
  771. X#define CHARFUDGE    1.0    /* fudge for vertically centering text */
  772. X
  773. X/* dimensions of dolby symbol */
  774. X#define DOLBY_HEIGHT    5.0
  775. X#define DOLBY_WIDTH    (DOLBY_HEIGHT+1.0)
  776. X#define DOLBY_RADIUS    (DOLBY_HEIGHT / 2.0)
  777. X
  778. X/* font used for album title */
  779. X#define TITLEFONT    "Helvetica-Bold"
  780. X#define TITLESIZE    10.0
  781. X
  782. X/* font used for secondary album title */
  783. X#define TITLE2FONT    "Times-Italic"
  784. X#define TITLE2SIZE    9.0
  785. X
  786. X/* font used for album artist */
  787. X#define ARTISTFONT    "Helvetica"
  788. X#define ARTISTSIZE    10.0
  789. X
  790. X/* font used for noise reduction */
  791. X#define NOISEFONT    "Helvetica"
  792. X#define NOISESIZE    5.0
  793. X
  794. X/* font used for song list */
  795. X#define SONGFONT    "Times-Roman"
  796. X#define SONGSIZE    8.0
  797. X
  798. X/* dimensions of cassette label in inches */
  799. X#define EDGEHEIGHT    0.5    /* height of label edge */
  800. X#define BODYHEIGHT    2.5    /* height of label body */
  801. X#define WIDTH        4.0    /* width of entire label */
  802. X
  803. X#define CONTINUEDIST    0.75    /* indent for long song name continuation */
  804. X
  805. X/* width of overhang tab */
  806. X#define TABWIDTH    (WIDTH - (TABDELTA * 2.0))
  807. X#define TABSHORTHEIGHT    0.25    /* height of short portion of overhang tab */
  808. X#define TABDELTA    0.25    /* delta between short and tall tab portions */
  809. SHAR_EOF
  810. if test 1774 -ne "`wc -c < 'dimensions.h'`"
  811. then
  812.     echo shar: "error transmitting 'dimensions.h'" '(should have been 1774 characters)'
  813. fi
  814. fi
  815. echo shar: "extracting 'Makefile'" '(1028 characters)'
  816. if test -f 'Makefile'
  817. then
  818.     echo shar: "will not over-write existing file 'Makefile'"
  819. else
  820. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  821. XCFLAGS = -O
  822. XLDFLAGS = -s
  823. X
  824. XCASSETTE = cassette
  825. XPRINTLABELS = printlabels
  826. XINSTALLDIR = /usr/loc
  827. XMANDIR = /usr/man/man1
  828. XSHARFILE = cassette.shar
  829. X
  830. XCFILES = input_file.c cassette.c output_ps.c overhead_ps.c
  831. XOFILES = input_file.o cassette.o output_ps.o overhead_ps.o
  832. XHFILES = cassette.h dimensions.h
  833. XMISCFILES = Makefile README cassette.1 \
  834. X        album1.sample album2.sample double.sample
  835. X
  836. XINSTALLFILES = $(INSTALLDIR)/$(CASSETTE) \
  837. X        $(INSTALLDIR)/$(PRINTLABELS) \
  838. X        $(MANDIR)/cassette.1
  839. X
  840. X$(CASSETTE): $(OFILES)
  841. X    cc $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES)
  842. X
  843. Xinstall: $(INSTALLFILES)
  844. X
  845. X$(INSTALLDIR)/$(CASSETTE): $(CASSETTE)
  846. X    cp $(CASSETTE) $@
  847. X    chmod 755 $@
  848. X
  849. X$(INSTALLDIR)/$(PRINTLABELS): $(PRINTLABELS)
  850. X    cp $(PRINTLABELS) $@
  851. X    chmod 755 $@
  852. X
  853. X$(MANDIR)/cassette.1: cassette.1
  854. X    cp cassette.1 $@
  855. X    chmod 644 $@
  856. X
  857. X$(SHARFILE): $(CFILES) $(HFILES) $(MISCFILES)
  858. X    shar $(CFILES) $(HFILES) $(MISCFILES) > $@
  859. X
  860. Xlint: $(CFILES)
  861. X    lint $(LINTFLAGS) $(CPPFLAGS) $(CFILES)
  862. X
  863. Xclean:
  864. X    /bin/rm -f $(OFILES) $(CASSETTE) $(SHARFILE)
  865. X
  866. Xtags: $(CFILES)
  867. X    ctags $(CFILES)
  868. SHAR_EOF
  869. if test 1028 -ne "`wc -c < 'Makefile'`"
  870. then
  871.     echo shar: "error transmitting 'Makefile'" '(should have been 1028 characters)'
  872. fi
  873. fi
  874. echo shar: "extracting 'README'" '(3893 characters)'
  875. if test -f 'README'
  876. then
  877.     echo shar: "will not over-write existing file 'README'"
  878. else
  879. sed 's/^X//' << \SHAR_EOF > 'README'
  880. XCassette label formatting programs:
  881. X    Build these with
  882. X    % make
  883. X    and install with
  884. X    % make install
  885. X    
  886. X    Dimensions, fonts, and other tweakable parameters are in dimensions.h.
  887. X    This was developed under UNIX 4.2 but ought to port to System V and
  888. X    other flavors easily.  Possible porting considerations are:
  889. X    bcopy() -- memcpy() (or something) in System V.
  890. X    fgets() -- reads line up to AND INCLUDING newline.
  891. X    perror() -- prints diagnostic error message for system calls.
  892. X    
  893. X    Happy listening!
  894. X
  895. XCassette:
  896. X    Cassette takes as input files describing the title, artist, and songs
  897. X    on the sides of a cassette tape, and sends a PostScript(TM) description
  898. X    of a cassette label suitable for sending to a high-resolution printer
  899. X    (such as a laserprinter) to the standard output.  The resulting label
  900. X    may be inserted into a standard-issue cassette tape case.
  901. X
  902. X    The input file format is the following:
  903. X    One file for each album (collection of artist, title, and songs).
  904. X    The first line of each file is the artist, the second is the title,
  905. X    the third is the noise reduction scheme used, and the songs are
  906. X    listed one-per-line thereafter.
  907. X
  908. X    An empty title line signifies a self-titled album.
  909. X    An empty noise-reduction line indicates no noise reduction used.
  910. X    An empty song line divides songs on the first side of the tape
  911. X    from those on the second side (a la two-record set).
  912. X
  913. X    Leading and trailing white space on any line is not significant.
  914. X
  915. X    The cassette program copes with:
  916. X    1) Extra-long artist, title, and song names.
  917. X    2) Recognizing Dolby(TM) B and C (and outputting the Dolby symbol).
  918. X    3) Long song list -- outputs an extended label outline.
  919. X    4) Self-titled albums
  920. X    5) One side of a tape unused.
  921. X    And much, much more.
  922. X
  923. X    Syntax:
  924. X    cassette [-n]  <album1 file>  [<album2 file>]
  925. X
  926. X    The '-n' option triggers numbering of the songs.
  927. X
  928. XPrintlabels:
  929. X    Printlabels is a simplistic bourne-shell script that takes the output
  930. X    of cassette (above) and surrounds it with PostScript(TM) commands to
  931. X    orient the output for more efficient printing on an 8 1/2 by 11 page.
  932. X    The output of Printlabels is sent to the standard output.
  933. X    Four non-extended labels or two extended ones can fit on a page, and
  934. X    page-feeds are inserted every four labels automatically.
  935. X
  936. X    Syntax:
  937. X    printlabels [-a] [-m]  <label file>  [<label file>...]
  938. X
  939. X    The '-a' option places the labels adjacent to one another
  940. X    for easier paper cutting.
  941. X
  942. X    The '-m' option enables manual feeding of the printer (for
  943. X    thick paper and such).
  944. X
  945. XKnown Bugs:
  946. X    On a single tape side, titles and artists longer than about
  947. X    80 characters or songlists longer than about 20 songs overflow
  948. X    the available room.
  949. X
  950. X    The manual-feed option to 'printlabels' might only work on the
  951. X    Apple Laserwriter Plus(TM).
  952. X
  953. X    If an album has a long song list that requires an extended area to
  954. X    hold it, the label must be printed with 'printlabels', or the
  955. X    label definition must be offset into the page.
  956. X
  957. X    'Printlabels' automatically fits four labels to a page even if the
  958. X    labels have an extension area (and thus won't fit).
  959. X
  960. X    The '-a' and '-m' flags may not be reversed in order on the command line.
  961. X
  962. X
  963. XExample:
  964. X    % cassette -n album1.sample album2.sample > label1.ps
  965. X    % cassette -n double.sample > label2.ps
  966. X    % printlabels -a -m label1.ps label2.ps | lpr -Plaser
  967. X
  968. X
  969. XBug reports/fixes or enhancements may be sent to me (Tom Smith) at
  970. X    {hplabs, ucbvax!sun!sunncal}!analog!smith
  971. X
  972. X
  973. XCopyright (C) 1987, Thomas H. Smith -- San Francisco, California
  974. X   Permission is granted to any individual or institution
  975. X   to use, copy, modify, or redistribute this software so long as it
  976. X   is not sold for profit and provided this copyright notice is retained.
  977. X
  978. X   PostScript is a registered trademark of Adobe Systems, Inc.
  979. X   The name 'Dolby' and the Dolby symbol are trademarks
  980. X    of Dolby Industries, Inc.
  981. SHAR_EOF
  982. if test 3893 -ne "`wc -c < 'README'`"
  983. then
  984.     echo shar: "error transmitting 'README'" '(should have been 3893 characters)'
  985. fi
  986. fi
  987. echo shar: "extracting 'cassette.1'" '(3398 characters)'
  988. if test -f 'cassette.1'
  989. then
  990.     echo shar: "will not over-write existing file 'cassette.1'"
  991. else
  992. sed 's/^X//' << \SHAR_EOF > 'cassette.1'
  993. X.\" @(#)cassette.1 ths 87/10/1;
  994. X.TH CASSETTE 1 "1 October 1987"
  995. X.SH NAME
  996. Xcassette, printlabels \- postscript formatter for cassette labels
  997. X.SH SYNOPSIS
  998. X.B cassette
  999. X[
  1000. X.B \-n
  1001. X]  albumfile1  [ albumfile2 ]
  1002. X.br
  1003. X.B printlabels
  1004. X[
  1005. X.B \-a
  1006. X]  [
  1007. X.B \-m
  1008. X]  labelfile  [ labelfile \fB.\|.\|.\fP ]
  1009. X.\"
  1010. X.\"    **************************************
  1011. X.\"
  1012. X.SH DESCRIPTION
  1013. X.I Cassette
  1014. Xtakes as input files describing the title, artist, and songs
  1015. Xon the sides of a cassette tape, and sends a PostScript(TM) description
  1016. Xof a cassette label suitable for sending to a high-resolution printer
  1017. X(such as a laserprinter) to the standard output.  The resulting label
  1018. Xmay be inserted into a standard-issue cassette tape case.
  1019. X.HP 5
  1020. XInput file format:
  1021. X.br
  1022. XOne file for each album (collection of artist, title, and songs).
  1023. X.sp
  1024. XThe first line of each file is the artist, the second is the title,
  1025. Xthe third is the noise reduction scheme used, and the songs are
  1026. Xlisted one-per-line thereafter.
  1027. X.sp
  1028. XAn empty title line signifies a self-titled album.
  1029. X.sp
  1030. XAn empty noise-reduction line indicates no noise reduction used.
  1031. X.sp
  1032. XAn empty song line divides songs on the first side of the tape
  1033. Xfrom those on the second side (a la two-record set).
  1034. X.sp
  1035. XLeading and trailing white space on any line is not significant.
  1036. X.HP 5
  1037. X.I Cassette
  1038. Xcopes with:
  1039. X.br
  1040. XExtra-long artist, title, and song names.
  1041. X.sp
  1042. XRecognizing Dolby(TM) B and C (and outputting the Dolby symbol).
  1043. X.sp
  1044. XLong song list -- outputs an extended label outline.
  1045. X.sp
  1046. XSelf-titled albums
  1047. X.sp
  1048. XOne side of a tape unused.
  1049. X.sp
  1050. XAnd much, much more.
  1051. X.LP
  1052. X.I Printlabels
  1053. Xis a simplistic bourne-shell script that takes the output
  1054. Xof
  1055. X.I cassette
  1056. Xand surrounds it with PostScript(TM) commands to
  1057. Xorient the output for more efficient printing on an 8 1/2 by 11 page.
  1058. XThe output of Printlabels is sent to the standard output.
  1059. XFour non-extended labels or two extended ones can fit on a page, and
  1060. Xpage-feeds are inserted every four labels automatically.
  1061. X.\"
  1062. X.\"    **************************************
  1063. X.\"
  1064. X.SH OPTIONS
  1065. X.TP
  1066. X.B \-n
  1067. X.I cassette:
  1068. Xtriggers numbering of the songs.
  1069. X.TP
  1070. X.B \-a
  1071. X.I printlabels:
  1072. Xplaces the labels adjacent to one another
  1073. Xfor easier paper cutting.
  1074. X.TP
  1075. X.B \-m
  1076. X.I printlabels:
  1077. Xenables manual feeding of the printer (for
  1078. Xthick paper and such).
  1079. X.\"
  1080. X.\"    **************************************
  1081. X.\"
  1082. X.SH EXAMPLES
  1083. X% cassette -n album1.sample album2.sample > label1.ps
  1084. X.br
  1085. X% cassette -n double.sample > label2.ps
  1086. X.br
  1087. X% printlabels -a -m label1.ps label2.ps | lpr -Plaser
  1088. X.br
  1089. X.\"
  1090. X.\"    **************************************
  1091. X.\"
  1092. X.SH BUGS
  1093. XOn a single tape side, titles and artists longer than about
  1094. X80 characters or songlists longer than about 20 songs overflow
  1095. Xthe available room.
  1096. X.LP
  1097. XThe manual-feed option to
  1098. X.I printlabels
  1099. Xmight only work on the
  1100. XApple Laserwriter Plus(TM).
  1101. X.LP
  1102. XIf an album has a long song list that requires an extended area to
  1103. Xhold it, the label must be printed with
  1104. X.I printlabels,
  1105. Xor the
  1106. Xlabel definition must be offset into the page.
  1107. X.LP
  1108. X.I Printlabels
  1109. Xautomatically fits four labels to a page even if the
  1110. Xlabels have an extension area (and thus won't fit).
  1111. X.LP
  1112. XThe '-a' and '-m' flags to
  1113. X.I printlabels
  1114. Xmay not be reversed in order on the command line.
  1115. X.\"
  1116. X.\"    **************************************
  1117. X.\"
  1118. X.SH ACKNOWLEDGEMENTS
  1119. X.I PostScript
  1120. Xis a registered trademark of Adobe Systems, Inc.
  1121. X.br
  1122. XThe name
  1123. X.I Dolby
  1124. Xand the Dolby symbol are trademarks of Dolby Industries, Inc.
  1125. SHAR_EOF
  1126. if test 3398 -ne "`wc -c < 'cassette.1'`"
  1127. then
  1128.     echo shar: "error transmitting 'cassette.1'" '(should have been 3398 characters)'
  1129. fi
  1130. fi
  1131. echo shar: "extracting 'album1.sample'" '(289 characters)'
  1132. if test -f 'album1.sample'
  1133. then
  1134.     echo shar: "will not over-write existing file 'album1.sample'"
  1135. else
  1136. sed 's/^X//' << \SHAR_EOF > 'album1.sample'
  1137. XEverything But the Girl
  1138. XBaby, The Stars Shine Bright
  1139. XDolby C
  1140. X    Come On Home
  1141. X    Don't Leave Me Behind
  1142. X    A Country Mile
  1143. X    Cross My Heart
  1144. X    Don't Let the Teardrops Rust Your Shining Heart
  1145. X    Careless
  1146. X    Sugar Finneyy
  1147. X    Come Hell or High Water
  1148. X    Fighting Talk
  1149. X    Little Hitler
  1150. SHAR_EOF
  1151. if test 289 -ne "`wc -c < 'album1.sample'`"
  1152. then
  1153.     echo shar: "error transmitting 'album1.sample'" '(should have been 289 characters)'
  1154. fi
  1155. fi
  1156. echo shar: "extracting 'album2.sample'" '(200 characters)'
  1157. if test -f 'album2.sample'
  1158. then
  1159.     echo shar: "will not over-write existing file 'album2.sample'"
  1160. else
  1161. sed 's/^X//' << \SHAR_EOF > 'album2.sample'
  1162. XHappy Hour
  1163. X
  1164. XDolby
  1165. X    Happy Hour
  1166. X    When I Say (No Giveaway)
  1167. X    Sunshine in the Shade
  1168. X    These Days
  1169. X    Too Late Now
  1170. X    Cheque in the Post
  1171. X    Precious Time
  1172. X    Sitting on a Fence
  1173. X    Opportunity
  1174. SHAR_EOF
  1175. if test 200 -ne "`wc -c < 'album2.sample'`"
  1176. then
  1177.     echo shar: "error transmitting 'album2.sample'" '(should have been 200 characters)'
  1178. fi
  1179. fi
  1180. echo shar: "extracting 'double.sample'" '(366 characters)'
  1181. if test -f 'double.sample'
  1182. then
  1183.     echo shar: "will not over-write existing file 'double.sample'"
  1184. else
  1185. sed 's/^X//' << \SHAR_EOF > 'double.sample'
  1186. XLittle Feat
  1187. XWaiting For Columbus
  1188. XDolby C
  1189. X  Join the Band
  1190. X  Fat Man in the Bathtub
  1191. X  All That You Dream
  1192. X  Oh Atlanta
  1193. X  Old Folks' Boogie
  1194. X  Time Loves a Hero
  1195. X  Day or Night
  1196. X  Mercenary Territory
  1197. X  Spanish Moon
  1198. X
  1199. X  Dixie Chicken
  1200. X  Tripe Face Boogie
  1201. X  Rocket in My Pocket
  1202. X  Willin'
  1203. X  Don't Bogart That Joint
  1204. X  A Apolitical Blues
  1205. X  Sailin' Shoes
  1206. X  Feats Don't Fail Me Now
  1207. SHAR_EOF
  1208. if test 366 -ne "`wc -c < 'double.sample'`"
  1209. then
  1210.     echo shar: "error transmitting 'double.sample'" '(should have been 366 characters)'
  1211. fi
  1212. fi
  1213. exit 0
  1214. #    End of shell archive
  1215.